package top.lshaci.learning.springboot.web.controller;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.lshaci.learning.springboot.web.model.Java8Time;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * Java8TimeController
 *
 * @author liangxu
 */
@RestController
@RequestMapping("/java8time")
public class Java8TimeController {

    @PostMapping("localdate")
    public Object localDate(@RequestBody LocalDate localDate) {
        return localDate;
    }

    @PostMapping("localdatetime")
    public Object localDateTime(@RequestBody LocalDateTime localDateTime) {
        return localDateTime;
    }

    @PostMapping("dto")
    public Object dto(@RequestBody Java8Time java8Time) {
        return java8Time;
    }
}
